package com.deco.back.controller.product;

import java.util.List;

import javax.jws.WebParam;
import javax.servlet.http.HttpServletRequest;

import com.free.common.vo.PageResponseVo;
import com.free.common.vo.PageSearchVo;
import com.free.ext.shiro.SessionManager;
import com.free.ext.web.spring.annoation.PageSearch;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.deco.domain.vo.fix.FixGeneralVo;
import com.deco.domain.vo.fix.FixTypeVo;
import com.deco.domain.vo.product.PartsCategoryVo;
import com.deco.domain.vo.product.SecuritySystemVo;
import com.deco.service.fix.FixGeneralService;
import com.deco.service.fix.FixTypeService;
import com.deco.service.product.PartsCategoryService;
import com.deco.service.product.SecuritySystemService;
import com.free.common.vo.ResultModel;

import org.springframework.web.servlet.ModelAndView;

/**
 * 广告管理 Controller
 * @author lengy
 *
 */
@Controller
public class SecuritySystemController {
    @Autowired
    private SecuritySystemService securitySystemService;

    @RequestMapping(value = "/security_system_list.do")
    public ModelAndView listPage(){
        ModelAndView mv = new ModelAndView("prod/securitysystemedit");
        List<SecuritySystemVo> list = securitySystemService.getAll();
        if(list != null && list.size() > 0){
    	   mv.addObject("obj", list.get(0));
        }
        else{
        	mv.addObject("obj",new SecuritySystemVo());
        }
     
        return mv;
    }

    @RequestMapping(value ="/security_system_edit_submit.do")
    @ResponseBody
    public ResultModel udpate(SecuritySystemVo vo){
        return securitySystemService.save(vo);
    }


}
